/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
function comprobarI(){
	var name = document.getElementById("name");
        var day = document.getElementById("day");
        var month = document.getElementById("month");
         var year = document.getElementById("year");
	var espacios = /^\s*$/;
	var campoNombre = /^Nombre$/;
	var comentario = "";
	var error = false;
	var color;
	
	
	if(!(espacios.test(name.value))){
		color = document.getElementById("label_name");
		color.style.color = "black";
	}else{
		color = document.getElementById("label_name");
		color.style.color = "red";
	}
	if(espacios.test(name.value) || campoNombre.test(name.value)){
		comentario = comentario + "Debe rellenar el campo 'Nombre'.\n";
		color = document.getElementById("label_name");
		color.style.color = "red";
		error = true;
	}
        if(!(espacios.test(day.value))){
		color = document.getElementById("label_day");
		color.style.color = "black";
	}else{
		color = document.getElementById("label_day");
		color.style.color = "red";
	}
	if(espacios.test(day.value)){
		comentario = comentario + "Debe rellenar el campo 'Day'.\n";
		color = document.getElementById("label_day");
		color.style.color = "red";
		error = true;
	}
         if(!(espacios.test(month.value))){
		color = document.getElementById("label_month");
		color.style.color = "black";
	}else{
		color = document.getElementById("label_month");
		color.style.color = "red";
	}
	if(espacios.test(month.value)){
		comentario = comentario + "Debe rellenar el campo 'Month'.\n";
		color = document.getElementById("label_month");
		color.style.color = "red";
		error = true;
	}
                 if(!(espacios.test(year.value))){
		color = document.getElementById("label_year");
		color.style.color = "black";
	}else{
		color = document.getElementById("label_year");
		color.style.color = "red";
	}
	if(espacios.test(year.value)){
		comentario = comentario + "Debe rellenar el campo 'Year'.\n";
		color = document.getElementById("label_year");
		color.style.color = "red";
		error = true;
	}
	if(error){
		alert(comentario);
	}
	return !error;
}

